<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <p>IPhone 13秒杀页面 </p>
    <button onclick="secondKill()">秒杀</button>

    <script type="text/javascript" th:src="@{/jquery-2.1.4.js}"></script>
    <script type="text/javascript" th:src="@{/layer/layer.js}"></script>
    <script type="text/javascript" th:src="@{/mylayer.js}"></script>
    <script>
        function secondKill() {
            console.log('log');
            $.post(
                '/product/secondKill',
                {'productId':27},
                function(jsonResult){
                    if (jsonResult.ok) {
                        mylayer.okMsg(jsonResult.msg);
                    } else {
                        mylayer.errorMsg(jsonResult.msg);
                    }
                },
                'json'
            );
        }
    </script>
</body>
</html>